&:active {@include button(active, $c:$bg);}
&:checked {@include button(checked, $c:$bg);}
}
+
+//
+// Panel menu/button drawing function
+//
+// $bg: background color, derived from $panel_fg_color
+// $fg: foreground color, also derived from $panel_fg_color
+//
+// $flat: if true, the button is filled instead of transparent
+// $highlighted_child: if true, applies some special overrides for to a
+// child element, see _panel.scss for details
+//
+
+@mixin panel_button($bg:$panel_fg_color, $fg:$panel_fg_color, $flat: true, $highlighted_child: false, $child_class:"") {
+
+ transition-duration: 150ms;
+ border: 3px solid transparent;
+ border-radius: 99px;
+
+ font-weight: bold;
+ background-color: transparent;
+ color: $fg;
+
+ @if $flat {
+ box-shadow: none;
+
+ &:active, &:overview, &:focus, &:checked {
+ box-shadow: inset 0 0 0 100px transparentize($bg, 0.75);
+ &:hover {
+ box-shadow: inset 0 0 0 100px transparentize($bg, 0.65);
+ }
+ }
+
+ &:hover {
+ box-shadow: inset 0 0 0 100px transparentize($bg, 0.8);
+ }
+
+ } @else {
+ box-shadow: inset 0 0 0 100px transparentize($bg, 0.2);
+
+ &:active, &:overview, &:focus, &:checked {
+ box-shadow: inset 0 0 0 100px $bg;
+ &:hover {
+ box-shadow: inset 0 0 0 100px transparentize($bg, 0.05);
+ }
+ }
+
+ &:hover {
+ box-shadow: inset 0 0 0 100px transparentize($bg, 0.1);
+ }
+ }
+
+ // some overrides to style a child element
+ @if $highlighted_child {
+ box-shadow: none !important;
+
+ #{$child_class} {
+ transition-duration: 150ms;
+ border: 3px solid transparent;
+ border-radius: 99px;
+ }
+
+ &:active, &:overview, &:focus, &:checked {
+ box-shadow: none !important;
+
+ #{$child_class} {
+ box-shadow: inset 0 0 0 100px transparentize($bg, 0.75);
+ }
+
+ &:hover {
+ box-shadow: none !important;
+ #{$child_class} {
+ box-shadow: inset 0 0 0 100px transparentize($bg, 0.65);
+ }
+ }
+ }
+
+ &:hover {
+ box-shadow: none !important;
+ #{$child_class} {
+ box-shadow: inset 0 0 0 100px transparentize($bg, 0.8);
+ }
+ }
+ }
+}
&:overview {
background-color: transparent;
box-shadow: none;
+
.panel-button {
- color: $panel_system_fg_color !important;
+ @include panel_button($panel_system_fg_color);
}
}
// panel menus
.panel-button {
- font-weight: bold;
- color: $panel_fg_color;
+ @include panel_button($panel_fg_color);
-natural-hpadding: $base_padding * 2;
-minimum-hpadding: $base_padding;
- transition-duration: 150ms;
- border: 3px solid transparent;
- border-radius: 99px;
-
- &.clock-display {
- .clock {
- transition-duration: 150ms;
- border: 3px solid transparent;
- border-radius: 99px;
- }
- }
-
- &.screen-recording-indicator {
- box-shadow: inset 0 0 0 100px $screenshot_ui_button_red;
- }
-
- &.screen-sharing-indicator {
- box-shadow: inset 0 0 0 100px $warning_color;
- StBoxLayout { margin: 0 $base_padding; }
- }
-
- &.screen-recording-indicator,
- &.screen-sharing-indicator {
- StBoxLayout {
- spacing: $base_padding;
- }
-
- StIcon {
- icon-size: $base_icon_size;
- }
- }
-
- &:active, &:overview, &:focus, &:checked {
- box-shadow: inset 0 0 0 100px transparentize($panel_fg_color, 0.8);
-
- // The clock display needs to have the background on .clock because
- // we want to exclude the do-not-disturb indicator from the background
- &.clock-display {
- box-shadow: none;
-
- .clock {
- box-shadow: inset 0 0 0 100px transparentize($panel_fg_color, 0.8);
- }
- }
-
- &.screen-recording-indicator {
- box-shadow: inset 0 0 0 100px transparentize($screenshot_ui_button_red, 0.15);
- }
- &.screen-sharing-indicator {
- box-shadow: inset 0 0 0 100px transparentize($warning_color, 0.15);
- }
- }
-
- &:hover {
- box-shadow: inset 0 0 0 100px transparentize($panel_fg_color, 0.85);
- &.clock-display {
- box-shadow: none;
- .clock {
- box-shadow: inset 0 0 0 100px transparentize($panel_fg_color, 0.85);
- }
- }
-
- &.screen-recording-indicator {
- box-shadow: inset 0 0 0 100px transparentize($screenshot_ui_button_red, 0.1);
- }
- &.screen-sharing-indicator {
- box-shadow: inset 0 0 0 100px transparentize($warning_color, 0.1);
- }
- }
-
- &:active:hover, &:overview:hover, &:focus:hover, &:checked:hover {
- box-shadow: inset 0 0 0 100px transparentize($panel_fg_color, 0.75);
- &.clock-display {
- box-shadow: none;
- .clock {
- box-shadow: inset 0 0 0 100px transparentize($panel_fg_color, 0.75);
- }
- }
-
- &.screen-recording-indicator {
- box-shadow: inset 0 0 0 100px transparentize($screenshot_ui_button_red, 0.2);
- }
- &.screen-sharing-indicator {
- box-shadow: inset 0 0 0 100px transparentize($warning_color, 0.2);
- }
- }
// status area icons
.system-status-icon {
&#panelActivities {
-natural-hpadding: $base_padding * 3;
}
- }
- &.unlock-screen,
- &.login-screen,
- &:overview {
- .panel-button {
- &:active, &:overview, &:focus, &:checked {
- box-shadow: inset 0 0 0 100px transparentize($panel_system_fg_color, 0.85);
-
- &.clock-display {
- box-shadow: none;
-
- .clock {
- box-shadow: inset 0 0 0 100px transparentize($panel_system_fg_color, 0.85);
- }
- }
-
- &.screen-recording-indicator {
- box-shadow: inset 0 0 0 100px transparentize($screenshot_ui_button_red, 0.15);
- }
- &.screen-sharing-indicator {
- box-shadow: inset 0 0 0 100px transparentize($warning_color, 0.15);
- }
+ // screen activity indicators
+ &.screen-recording-indicator,
+ &.screen-sharing-indicator {
+ StBoxLayout {
+ spacing: $base_padding;
}
- &:hover {
- box-shadow: inset 0 0 0 100px transparentize($panel_system_fg_color, 0.90);
- &.clock-display {
- box-shadow: none;
- .clock {
- box-shadow: inset 0 0 0 100px transparentize($panel_system_fg_color, 0.90);
- }
- }
-
- &.screen-recording-indicator {
- box-shadow: inset 0 0 0 100px transparentize($screenshot_ui_button_red, 0.1);
- }
- &.screen-sharing-indicator {
- box-shadow: inset 0 0 0 100px transparentize($warning_color, 0.1);
- }
+ StIcon {
+ icon-size: $base_icon_size;
}
+ }
- &:active:hover, &:overview:hover, &:focus:hover, &:checked:hover {
- box-shadow: inset 0 0 0 100px transparentize($panel_system_fg_color, 0.8);
- &.clock-display {
- box-shadow: none;
- .clock {
- box-shadow: inset 0 0 0 100px transparentize($panel_system_fg_color, 0.8);
- }
- }
-
- &.screen-recording-indicator {
- box-shadow: inset 0 0 0 100px transparentize($screenshot_ui_button_red, 0.2);
- }
- &.screen-sharing-indicator {
- box-shadow: inset 0 0 0 100px transparentize($warning_color, 0.2);
- }
+ &.screen-recording-indicator {
+ @include panel_button($screenshot_ui_button_red, $flat: false);
+ }
+
+ &.screen-sharing-indicator {
+ @include panel_button($warning_color, transparentize(black, 0.2), $flat: false);
+ }
+
+ // clock
+ &.clock-display {
+ // The clock display needs to have the background on .clock because
+ // we want to exclude the do-not-disturb indicator from the background
+ // see _drawing.scss for override details
+ @include panel_button($highlighted_child: true, $child_class:".clock");
+
+ .clock {
+ // the highlighted child
}
}
}
// Clock
-
.clock-display-box {
spacing: 2px;
-
.clock {
padding-left: $base_padding * 2;
padding-right: $base_padding * 2;